home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / fretext1.sit / Free Text Help_Services v1.01 / card_21114.txt < prev    next >
Text File  |  1990-04-13  |  25KB  |  458 lines

  1. -- card: 21114 from stack: in.01
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 7910
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. /* part 1 of 2 */
  11.  
  12.  
  13. NOTES ON FREE TEXT INFORMATION RETRIEVAL
  14.    by Mark Zimmermann, March 1990
  15.  
  16. I've been thinking recently about some fundamental issues in big
  17. free-text databases ... specifically, whether it will be feasible to
  18. handle 100 MB/day or so of unstructured text (from wire services,
  19. USENET, database downloads, scanned-in magazines, etc.) and do useful
  20. research on it, the way that my FREE TEXT indexer/browser programs on
  21. the Mac let you work with single files of tens of megabytes. I think
  22. that the answer is "yes", 100 MB/day is manageable (for how long? -- a
  23. month, at least?).  But it will require some (straightforward, I hope)
  24. extensions to my current indexer/browser systems.
  25.  
  26. This informal memorandum is a summary of my thoughts.  It includes
  27. comments on required features of the software, the technical design
  28. decisions behind my current information retrieval (IR) codes, key
  29. problems that must be solved to handle bigger free-text databases, and
  30. some suggestions for how to implement solutions to those problems.  My
  31. goal is to provide a record of where my general free text IR thoughts
  32. stand today, to help people who want to work with me on enhanced text
  33. handling tools for researchers.  I'd appreciate any comments or
  34. suggestions or corrections that anybody wants to make!
  35.  
  36.  
  37. REQUIREMENTS
  38.  
  39. I want real-time high-bandwidth responses to simple, common user queries
  40. of the free-text database.  By "real-time" I mean that single-term
  41. retrieval requests should be answered in less than a second.  (Complex
  42. Boolean proximity searches can take a bit longer to set up and execute,
  43. but even there, speed is important.)  By "high-bandwidth" I mean that
  44. the human has to get information back from the computer in a useful form
  45. which can be evaluated quickly -- it's not good enough to return a list
  46. of documents or files, each of which has to be paged through in order to
  47. find the few relevant items.  By "free- text" I mean that the input
  48. stream can't be assumed to include any regular structure beyond words
  49. separated by delimiters (spaces, punctuation, etc.).
  50.  
  51. I want tools for the earliest stages of research, when a person needs to
  52. be able to browse and free-associate without even knowing what are the
  53. right questions to ask.  Users have to be able to work with the database
  54. without intimate knowledge of the details of what's in it (since nobody
  55. will have time to read much of a 100 MB/day flood of information). A big
  56. database in a particular area has to be a "corporate memory" for groups
  57. of scholars who are working on related topics.  A new person has to be
  58. able to come in and do research without extensive training, and an
  59. experienced user has to find the system transparent, so that it becomes
  60. an extension of her memory, not a barrier to getting at the data and
  61. thinking with it.  I see free-text IR tools as coexisting with other
  62. types of tools, such as structured databases which are appropriate for
  63. answering well-formulated queries at later phases of the research
  64. effort.
  65.  
  66. I know of four fundamental end-user operations that a good real-time
  67. high-bandwidth free-text IR system must support:
  68.    - viewing lists of words that occur in a database;
  69.    - selecting subsets of a big database to work within;
  70.    - browsing through candidate items efficiently; and
  71.    - reading and taking notes on retrieved information.
  72. I'll discuss each of these four tasks below.
  73.  
  74.  
  75. WORD LISTS
  76.  
  77. Viewing lists of words that occur in a database is exceedingly useful,
  78. for many reasons.  An alphabetized word list makes it easy to spot many
  79. misspellings and variant suffixes for search terms.  Word lists are
  80. surprisingly useful in working with mixed-language databases,
  81. particularly in spotting cognates and words that begin similarly to
  82. related native-language terms.  The ability to view a word list, along
  83. with numerical information about occurrence rates in the whole database
  84. and in subsets, is valuable in formulating better queries that maximize
  85. good data retrieval.  Perhaps most importantly, just being able to
  86. scroll around in a list of terms is a superb aide-memoire in thinking of
  87. words worth looking for in a database.  Visible word lists are much
  88. better than blind searching, even when wild cards are permitted.  It's
  89. precisely analogous to the "recognize vs. remember" dichotomy between
  90. menu-driven and command-line user interfaces.
  91.  
  92. Word lists are easy to generate, provided that one has built a complete
  93. inverted index to the database being browsed.  For example:
  94.  
  95.        1    8805251042
  96.        1    9511
  97.     6774    A
  98.        1    AA01693
  99.        1    AA03935
  100.        2    AA13961
  101.        1    AA29900
  102.       34    ABLE
  103.      291    ABOUT
  104.       29    ABOVE
  105.  
  106. Each word is preceded by the number of times it occurs in the database
  107. as a whole.  Note the presence of numbers and document identifiers as
  108. well as ordinary words.
  109.  
  110. A word list doesn't need to take up much storage space as files get big,
  111. since the number of distinct words grows much slower than the file size.
  112. There are various rules of thumb and theoretical formulae, such as
  113. Zipf's Law, for estimating how big the word lists will get.  In my
  114. experience, unique dates, other numbers, garbles, typos, etc. tend to
  115. keep the word lists growing more than expected, but not at an
  116. unmanageable rate.
  117.  
  118. My free text IR programs use an extremely simple file structure, which
  119. makes generating word lists nearly trivial. In the "keys" index file, I
  120. store as an array the words found in the database along with count
  121. information.  Thus, a single disk access can fill a small window with an
  122. alphabetized word list along with each word's frequency of occurrence in
  123. the database as a whole.  (See the discussion under BROWSING below for
  124. information on how counts are displayed when working in a subset of the
  125. database.)
  126.  
  127. In my programs, I currently truncate words rather arbitrarily after 28
  128. characters; I keep 4 bytes of cumulative count as a long integer; I
  129. default to a standard character mapping from lower-case to upper-case; I
  130. default to break words apart at punctuation marks; and I default to
  131. alphabetizing according to the ASCII character set order.  These choices
  132. work well for English-language texts in my experience, and they're
  133. easily changed if necessary by recompiling the indexing and browsing
  134. programs.  (In a future version of my programs, I intend to allow at
  135. least the character mapping and alphabetization order to be defined
  136. separately for each database; see the EXTENSIONS AND ENHANCEMENTS
  137. section below.)
  138.  
  139. These design choices mean that each distinct word in a database occupies
  140. 32 bytes in the "keys" index file.  It is possible to save a little
  141. space by using a more complex data structure, but it would be at the
  142. cost of speed and simplicity in the indexing and browsing programs.  In
  143. fact, as databases get larger the storage used by the "keys" file
  144. becomes increasingly insignificant compared to the database and the
  145. other part of the index (the "pointers" file, discussed under SUBSETS
  146. and elsewhere below).  The four-byte cumulative count element of the
  147. data structure will limit the indexed databases to 2^32 total words.
  148. That's about 4 billion words, or roughly 25 GB total file size, given a
  149. typical word length of 5 letters plus 1 delimiter.  Modifications to
  150. this part of the index data structure will thus be necessary for very
  151. large free-text databases (see EXTENSIONS AND ENHANCEMENTS).
  152.  
  153. I index every word in the database, even common words such as "a" and
  154. "the".  Many free-text IR systems call such terms "stop words" and omit
  155. them.  The result is a saving of perhaps 20% - 40% in final index file
  156. size, depending on how long the stop word list is.  The cost, however,
  157. is too great -- it becomes impossible to search for common terms in
  158. proximity to each other or as components of names, part numbers, dates,
  159. and so forth.  A user can never find "To be, or not to be..." in
  160. Shakespeare, since every word in that phrase is a stop word! It also
  161. becomes impossible to look for "A. I. Smith" in a long name list, or to
  162. find many short Chinese or Japanese words at all.
  163.  
  164. I am inalterably against the use of stop words; I also oppose "stemming"
  165. or "truncation" in free-text indexing.  Many conventional systems
  166. attempt to remove suffixes so that they can index various forms of a
  167. word under a single entry; for instance, "compute", "computer",
  168. "computers", "computational", and "computing" might all be merged into a
  169. single "comput" entry.  This saves a small amount of space, but at the
  170. expense of simplicity and control for the user.  (At times, I may need
  171. to retrieve "computers" but not "computer".)  Many stemming systems also
  172. get confused easily and garble words (particularly proper nouns) --
  173. occasionally with disastrous results when a truncated term lands on the
  174. stop word list and is left out of the index entirely!  Foreign terms and
  175. oriental names are particularly vulnerable to butchery by such systems.
  176.  
  177.  
  178. SUBSETS
  179.  
  180. Researchers need to be able to select subsets of a big database to work
  181. within.  As information collections get very large, there will still be
  182. unique or nearly-unique terms that people will want to retrieve quickly
  183. -- the last occurrence of a particular name, a bizarre word or document
  184. identifier that only occurs once, etc.  But increasingly often, there
  185. will be too many instances of an important word for convenient browsing
  186. (but see the BROWSING section below for methods to delay that point).
  187. It thus becomes necessary to filter the input stream in a fast and
  188. flexible way, so that a human- usable volume of information is left to
  189. study.
  190.  
  191. Proximity search is a common free-text IR approach to data filtering.
  192. The usual proximity criteria, however, tend to be narrow, inflexible,
  193. and (in my experience) extremely hazardous to retrieval when applied to
  194. real-world databases.  A conventional form of proximity search is to
  195. enter a boolean query such as "FREE(w2)TEXT AND (INFORMATION OR
  196. RETRIEV*)" which translates into "give me any document with FREE
  197. occurring within two words before TEXT, which also contains INFORMATION
  198. or any word beginning with RETRIEV".  Of course, this example can't work
  199. at all if the database isn't already divided up into "document" units.
  200. Even if the query appears to work, the user will fail to see an
  201. unknowable number of near-miss items which contain some but not all of
  202. the specified words, or which use alternative spellings (including
  203. typographical errors).
  204.  
  205. The user interface for conventional boolean proximity search is simply
  206. terrible.  It doesn't provide enough feedback to let the user avoid
  207. subtle (or obvious) mistakes, it requires too much human memory and
  208. creative energy in query formulation, and it gets in the way of seeing
  209. the data.  Often, an apparently-innocuous term in a parenthesized
  210. boolean search statement actually distorts the entire meaning of the
  211. query and eliminates all the useful information that was to be
  212. retrieved.  Expert searchers can overcome some of the barriers that a
  213. command-line proximity search interface imposes, but it's never easy.
  214.  
  215. In my browser programs, I take a different approach.  I let a user
  216. define a neighborhood of interest in a free-text collection based on
  217. loose proximity to words chosen from the full database word list (see
  218. WORD LISTS above).  For reasons of speed, simplicity, and convenience,
  219. the subset proximity criterion is in bytes (characters of text), with a
  220. default resolution of 32 bytes.  Thus, a searcher could ask a fuzzy
  221. equivalent of the above sample boolean query by starting out with an
  222. empty subset and then adding the neighborhood of the word "FREE".  This
  223. is actually done by clicking on the word "FREE" as it is displayed in an
  224. Index View window -- a perfect opportunity to see nearby alternative
  225. search terms!  The default neighborhood is "within-a-few-words", roughly
  226. plus or minus 50 bytes.  At this point, an excerpt from the database
  227. subset's word list might be displayed as:
  228.  
  229.      5/34     ABLE
  230.      0/291    ABOUT
  231.      0/29     ABOVE
  232.      0/5      ABSTRACTS
  233.      9/41     ACCESS
  234.  
  235. (Here, the term "ABLE" occurs 34 times in the database as a whole, of
  236. which 5 instances are in the proximity neighborhood of "FREE".)
  237.  
  238. Next, after making a similar selection of the neighborhood around the
  239. word "TEXT", the user can narrow down the subset of interest to the
  240. intersection of the "FREE" and "TEXT" subsets. (This equivalent of the
  241. boolean AND operation is again done with a mouse click.) Then,
  242. broadening the neighborhood setting to 500 bytes or so, the user can
  243. with a few more clicks define another subset of words very loosely near
  244. INFORMATION or RETRIEVAL or RETRIEVALS or RETRIEVING, etc.  Intersecting
  245. that subset with the FREE TEXT subset gives the final subset of interest
  246. for interactive browsing.
  247.  
  248. My experience, and that of many users, is that my kind of fuzzy
  249. proximity search is far better than classical boolean search for finding
  250. the information that one really wants. It's faster, safer, and far more
  251. aesthetic to use as well. The mental model that the user has is simple
  252. and powerful: neighborhoods of influence that radiate out from
  253. interesting words, and the possible combinations of those neighborhoods.
  254. The proximity search interface, after a few minutes of use, becomes
  255. transparent and doesn't get in the way of thinking with the data.
  256.  
  257. My current indexer/browser programs assume that the free-text database
  258. is a single file.  That assumption is straightforward to lift, and I
  259. plan to do so soon (see EXTENSIONS AND ENHANCEMENTS).  But it is very
  260. convenient, for many purposes, to treat the entire database as a linear
  261. entity, and refer to byte offsets from the beginning of the database.
  262. Databases which have additional structure (sections, chapters, pages,
  263. etc.) can easily be handled within such a framework.
  264.  
  265. My current implementation of fuzzy proximity search uses vectors, linear
  266. arrays, to represent the database subsets. Each bit of a subset vector
  267. stands for a 32-byte (default value) section of free text.  A bit is
  268. cleared when its section is not included in a given neighborhood, and a
  269. bit is set when its section is part of the subset.  This approach of
  270. representing 32 bytes with 1 bit results in a compression factor of 256,
  271. so a gigabyte database can have a proximity neighborhood defined using a
  272. 4 MB vector.  Subset operations are trivially simple with this data
  273. structure.  (See the EXTENSIONS AND ENHANCEMENTS section for a
  274. discussion of what changes may be needed to handle multi-gigabyte
  275. databases.)
  276.  
  277. In order to set or clear bits in defining subsets, it is obviously
  278. necessary to have pointers to the locations of every word in the
  279. database.  (It is necessary to have such pointers in any event to
  280. retrieve information quickly, of course.)  The second index file that my
  281. programs use, the "pointers" file, is precisely that.  In the current
  282. implementation, it simply consists of 32-bit integers giving the offset
  283. from the beginning of the database to each indexed word.  Entries in the
  284. pointer file map directly to proximity subset vectors, making it easy to
  285. set and clear bits as needed to define regions of interest in the
  286. database.  (See the EXTENSIONS AND ENHANCEMENTS section for more on how
  287. this model can grow to handle larger data collections.)
  288.  
  289. Each instance of a word thus requires 4 bytes of space in the "pointers"
  290. file.  Since an average word is 5 letters long, plus one or more
  291. terminal spaces or other delimiters, the average "pointers" file is less
  292. than 80% of the size of the original database text file.  It would
  293. certainly be possible to save some disk space by compressing the
  294. "pointers" file, but I doubt that more than half of the original file
  295. size could be recovered.  There would also be a price to pay, in terms
  296. of slower retrieval, more severe database size limitations, and
  297. increasingly complex (and less reliable) software.  I thus chose to keep
  298. the "pointers" file structure as simple as possible.
  299.  
  300. Many conventional free-text IR systems, I suspect, generate in-memory
  301. lists in order to do proximity search operations. They tend to fail when
  302. looking for common words in conjunction with each other, probably when
  303. their data structures overflow. (I don't know for sure, as their
  304. algorithms are proprietary and unpublished; I deduce their design by
  305. observing their common fail cases.)  I much prefer my subset vector
  306. approach. It is simpler, it has guaranteed good run time behavior, and
  307. it never breaks down when working with dense database subsets.
  308.  
  309. Conventional free-text IR systems also (I suspect) keep lists of
  310. sentence and paragraph and document delimiters, in order to handle some
  311. types of proximity search requests.  I have never found it necessary (or
  312. even desirable) to pay much attention to rigidly-defined boundaries such
  313. as sentences or paragraphs in actually performing proximity searches.
  314. The fuzzier proximity search that I have implemented is, in actual
  315. experience, much safer and more likely to find the key data items that
  316. are being sought.  A user of my system will never lose a good piece of
  317. information due to an unfortunate sentence division or paragraphing
  318. choice by an author.  As a secondary benefit, there is no need to
  319. pre-process items flowing into the database in order to insert
  320. paragraph, section, or document boundary markers before indexing.
  321.  
  322.  
  323. BROWSING
  324.  
  325. The key to effective use of a free-text database is the ability to
  326. browse rapidly through many items in order to find the few that are of
  327. greatest interest.  A good free-text IR system has to provide lists of
  328. indexed words (see WORD LISTS above) and it has to fetch the full text
  329. of documents rapidly upon demand (see READING below).  But a great
  330. free-text IR system must also provide facilities to bridge the gap
  331. between word lists and full text retrieval.  I do this in my programs by
  332. applying an old concept, the "key word in context" display, in a new way
  333. which I call a "context view".
  334.  
  335. A "key word in context" listing, sometimes called a KWIC, is a set of
  336. lines extracted from a database which show the instances of a word's
  337. occurrence, each with some context on either side. The "key word" is
  338. lined up in a column down the middle of the page.  Static, printed KWIC
  339. indices have been around for many years, and are better than no index at
  340. all, but they don't provide fast, transparent access to data.  A user
  341. still has to track down the actual reference in order to get back to the
  342. full text of the item, and she still has no way to look at a subset of
  343. the original database.
  344.  
  345. My context views are key-word-in-context displays which are generated on
  346. the fly, at run time, in response to user requests.  They look like a
  347. common KWIC -- for example, a context view of six occurrences of
  348. "Macintosh" in a small file might reveal:
  349.  
  350.   rogram, without the Macintosh user interface features.  Ho
  351.   her features of the Macintosh Browser:   - easy access to
  352.   megabytes/hour on a Macintosh Plus, and over 60 megabytes/
  353.    [75066,2044].  The Macintosh Browser program is available
  354.   O-MAC> and the MAUG Macintosh Users' Forum on CompuServe.
  355.   send me a formatted Macintosh disk and a self-addressed st
  356.  
  357. Tabs, carriage returns, line feeds, etc. are all suppressed in a context
  358. view, to allow the user to see the maximum amount of information on each
  359. line.
  360.  
  361. A person can scroll around in a dynamic context view in a window on the
  362. computer's screen, and quickly eliminate many of the uninteresting
  363. usages of a word.  When an item looks promising, a mouse click
  364. immediately calls up the actual text from the original document for
  365. reading and possible further use.  (See READING below for further
  366. comments.) When working in a proximity subset of the whole database, the
  367. context view only shows the lines surrounding word instances in the
  368. subset of interest.
  369.  
  370. My experience indicates that a human can comfortably browse through
  371. hundreds of lines in a context view in order to locate a few good ones
  372. to retrieve.  It's at least an order of magnitude easier (and more
  373. pleasant!) than wading through full text documents as they are
  374. conventionally retrieved by IR systems.
  375.  
  376. The current implementation of context views in my FREE TEXT
  377. indexer/browser programs is straightforward.  For each line of context
  378. to be displayed, a single disk access is needed to fetch the characters
  379. from the appropriate point in the database file.  (Since the entries in
  380. the "pointers" file are already alphabetized and sorted together, one
  381. access to that file provides many windows worth of context view
  382. pointers; the cost of that access is thus negligible compared to the
  383. fetching that has to be done from the text database file.) With some
  384. operating-system caching of disk sectors as they are used, scrolling of
  385. a context view window is reasonably smooth.
  386.  
  387. In order to guarantee a fast response to user requests when working in a
  388. subset of the entire database, I currently apply a couple of simple
  389. tricks.  In generating the word list, for example, I give exact counts
  390. of the number of words in a subset only if that word occurs less than
  391. 100 times (default value).  Thus, for example, an entry in a word list
  392. might be:
  393.  
  394.     ~11%      A
  395.  
  396. I take a sample of the occurrences of "A" in the database and report
  397. back a percentage estimate of the fraction in the subset.  (To be
  398. precise, I default to counting the last 100 instances in the database.)
  399.  
  400. In generating a context view, when more than 100 (default value)
  401. instances of a word are skipped over because they fall outside the
  402. subset of interest, I display an indication of that as a line of dots in
  403. the context window; for example:
  404.  
  405.   ..........................................................
  406.   ..........................................................
  407.   megabytes/hour on a Macintosh Plus, and over 60 megabytes/
  408.   ..........................................................
  409.  
  410. If I didn't use this tactic, a user might try to retrieve in an empty
  411. subset and have to wait for the entire database to be scanned before a
  412. "no valid instances" message could come back. I find the quicker
  413. response of my approach superior, and I also find it useful to see an
  414. indication (by lines of dots) when I'm working in a "desert", an
  415. almost-empty subset.
  416.  
  417.  
  418. READING
  419.  
  420. The bottom line for a free-text IR system is to get a desired document
  421. (or excerpt) in front of the user, so that it can be read and worked
  422. with.  It goes without saying that a good IR system must make it easy to
  423. scroll around in a database, copy out selections, and paste them into
  424. working papers, other programs, or anyplace else that the user desires.
  425. Handling this interprocess communication is a job for the operating
  426. system, but the IR program must be at least open enough to make it very
  427. easy to export data to other programs.  If the original document in the
  428. database has some structure (and thus isn't purely "free text") it may
  429. be valuable to reflect that structure in the retrieved data. Chapter or
  430. section titles can be displayed, for instance, or if there are graphics
  431. or font style changes they can be shown properly.  The ultimate goal is
  432. to have the original document (or a high-resolution image of it) appear
  433. in front of the user, open to the right page, with a highlight to draw
  434. attention to the key part.  That's unfortunately not easy to do today!
  435.  
  436. My current systems go only partway toward meeting this goal. I display
  437. text and highlight the index term that was the original basis for the
  438. retrieval.  But I only extract a small chunk (a few thousand characters,
  439. by default) of the text document and let the user scroll around in that.
  440. It's hard to do more and still maintain the speed and simplicity of the
  441. software.  I don't handle non-textual elements of the database at all,
  442. and I only display a single font.
  443.  
  444. Beyond mere retrieval, an ideal free-text IR system would make it easy
  445. to annotate retrieved information, add valuable comments and leave a
  446. trail behind so that other explorers (or the same explorer, at a later
  447. date) could profit from previous experience.  Hypertextual links between
  448. documents should be easy to create (as one type of annotation, perhaps)
  449. and should be easy to see and follow.  They would then provide another
  450. set of paths through the data space.  All of these topics are under
  451. active research today, and perhaps within a few years robust,
  452. transportable systems to do such jobs will be available.  In the
  453. meantime, however, my top priority is to do a better job at the
  454. fundamental task -- fast, easy, open, good real-time high-bandwidth
  455. free-text information retrieval on big databases.
  456.  
  457.  
  458. /* end of part 1 of 2 - continued on next card */